Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[aeneas] Preserve variable names #3560

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

zhassan-aws
Copy link
Contributor

@zhassan-aws zhassan-aws commented Oct 1, 2024

In #3514, the LLBC does not keep the variable names from the Rust source. This PR extracts the names of variables from MIR and carries it over to the LLBC.

For instance, for tests/expected/llbc/basic1 which has the following Rust:

fn select(s: bool, x: i32, y: i32) -> i32 {
    if s { x } else { y }
}

without this PR, running Aeneas on the output LLBC produces:

def select (b : Bool) (i : I32) (i1 : I32) : Result I32 :=
  if b
  then Result.ok i
  else Result.ok i1

but with this PR, it produces:

def select (s : Bool) (x : I32) (y : I32) : Result I32 :=
  if s
  then Result.ok x
  else Result.ok y

This should not be merged before #3514, so keeping it as a draft for the time being.

The actual diff on top of #3514 can be viewed here: zhassan-aws/kani@llbc4...zhassan-aws:kani:llbc-names

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@github-actions github-actions bot added the Z-BenchCI Tag a PR to run benchmark CI label Oct 1, 2024
@zhassan-aws zhassan-aws marked this pull request as ready for review October 9, 2024 04:47
@zhassan-aws zhassan-aws requested a review from a team as a code owner October 9, 2024 04:47
@zhassan-aws zhassan-aws added this pull request to the merge queue Oct 18, 2024
Merged via the queue into model-checking:main with commit ab39455 Oct 18, 2024
26 of 27 checks passed
@zhassan-aws zhassan-aws deleted the llbc-names branch October 18, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-BenchCI Tag a PR to run benchmark CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants